<fieldset>
    <legend>{:lang('条件搜索')}</legend>
    <form class="layui-form layui-form-pane form-search" action="{:sysuri()}" onsubmit="return false" method="get" autocomplete="off">

        
     
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">{:lang('产品罐码')}</label>
            <label class="layui-input-inline">
                <input name="sncode" 
                value="{$get.sncode|default=''}" placeholder="{:lang('请输入产品罐码')}" class="layui-input">
            </label>
        </div>
        
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">{:lang('产品箱码')}</label>
            <label class="layui-input-inline">
                <input name="boxcode" 
                value="{$get.boxcode|default=''}" placeholder="{:lang('请输入产品箱码')}" class="layui-input">
            </label>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">{:lang('产品编号')}</label>
            <label class="layui-input-inline">
                <input name="ProductCD" 
                value="{$get.ProductCD|default=''}" placeholder="{:lang('请输入产品编号')}" class="layui-input">
            </label>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">{:lang('产品名称')}</label>
            <label class="layui-input-inline">
                <input name="ProductName" 
                value="{$get.ProductName|default=''}" placeholder="{:lang('请输入产品名称')}" class="layui-input">
            </label>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">{:lang('经销商编号')}</label>
            <label class="layui-input-inline">
                <input name="jxs_code" 
                value="{$get.jxs_code|default=''}" placeholder="{:lang('请输入经销商编号')}" class="layui-input">
            </label>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">{:lang('状态')}</label>
            <label class="layui-input-inline">
                <select name="is_send"  class="layui-select">
                    <option value="">全部</option>
                    <option value="2">已退货</option>
                    <option value="1">已下发</option>
                    <option value="0">在库</option>
                </select>
            </label>
        </div>

        <div class="layui-form-item layui-inline">
            <button type="submit" class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> {:lang('搜 索')}</button>
            <button type="button" data-form-export="{:url('index')}?type={$type|default=''}" class="layui-btn layui-btn-primary">
                <i class="layui-icon layui-icon-export"></i> {:lang('导 出')}
            </button>
        </div>
    </form>
</fieldset>

<script>
    require(['excel'], function (excel) {
        excel.bind(function (data) {

            // 设置表格内容
            data.forEach(function (item, index) {
                data[index] = [item.id, item.sncode, item.boxcode, item.jxs_code, item.ProductCD, item.ProductName, item.Norm, item.BatchNO,item.add_time,item.is_send];
            });

            // 设置表头内容
            data.unshift(['ID', '{:lang("罐码")}', '{:lang("箱码")}', '{:lang("经销商编号")}', '{:lang("商品编号")}', '{:lang("商品名称")}', 
            '{:lang("规格")}',
            '{:lang("批次")}',
            '{:lang("操作时间")}',
            '{:lang("状态")}']);

            return this.withStyle(data, {A: 60, B: 80, C: 99, E: 120, G: 120});

        }, '{:lang("经销商库存")}' + layui.util.toDateString(Date.now(), '_yyyyMMdd_HHmmss'));
    });
</script>